<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
		<title>HLS直播协议Demo</title>
		<link href="https://cdn.bootcdn.net/ajax/libs/video.js/7.10.1/video-js.min.css" rel="stylesheet">
	</head>
	<style type="text/css">
		html,body {
			margin: 0;
			padding: 0;
			width: 100%;
			height: 100%;
		}
	</style>
	<body>
		<video-js id=vid1 class="vjs-default-skin" style="width: 100%; height: 100%;" controls autoplay muted>
			<source src="" type="application/x-mpegURL">
		</video-js>
	
		<script src="https://cdn.bootcss.com/jquery/1.11.3/jquery.min.js"></script>
		<script src="https://cdn.bootcdn.net/ajax/libs/video.js/7.10.1/video.min.js"></script>
		<script src="./js/videojs-http-streaming.min.js"></script>
		<script>
        	// $(document).ready(function(){
            // 	var videoSrc ='https://qnewt2.qiyedaoshi.com/112-avid62263b52dd661.m3u8';//新的视频播放地址
            //         	player.src([
            //             	{type: "application/x-mpegURL", src: videoSrc}
            //         	])
			// 			var player = videojs('vid1');
            // 	player.play();
        	// });
			function getQueryVariable(variable)
			{
       			var query = window.location.search.substring(1);
      			 var vars = query.split("&");
       			for (var i=0;i<vars.length;i++) {
               		var pair = vars[i].split("=");
               		if(pair[0] == variable){return pair[1];}
       			}
      			 return(false);
			}
			$(function() {
				var player = videojs('vid1');
				var videoSrc =getQueryVariable("src");
				alert(videoSrc);
				//var videoSrc ='https://qnewt2.qiyedaoshi.com/112-avid62263b52dd661.m3u8';//新的视频播放地址
                    	player.src([
                        	{type: "application/x-mpegURL", src: videoSrc}
                    	])
				player.play();
			});
		</script>
	</body>
</html>
